<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>User Registration</title>
</h:head>
<h:body>
    <h1>User Registration</h1>
    <h:form>
        <h:panelGrid columns="3">
            First Name:
            <h:inputText label="First Name" id="firstName" required="true" size="30" value="#{u.firstName}">
                <f:validateRequired />
            </h:inputText>
            <h:message for="firstName" style="color:red" />
            Last Name:
            <h:inputText label="Last Name" id="lastName" required="true" size="30" value="#{u.lastName}">
                <f:validateRequired />
            </h:inputText>
            <h:message for="lastName" style="color:red" />
            Email Address:
            <h:inputText label="Email Address" id="emailAddress" required="true" size="30" value="#{u.emailAddress}">
                <f:validateRequired />
                <!-- <f:validateRegex pattern=".+@student.ndnu.edu$"></f:validateRegex> -->
            </h:inputText>
            <h:message for="emailAddress" style="color:red" />
            Password:
            <h:inputSecret label="Password" id="password" required="true" size="30" value="#{u.password}">
                <!-- <f:validateLength minimum="5" maximum="50" /> -->
                <f:validateRequired />
            </h:inputSecret>
            <h:message for="password" style="color:red" />
        </h:panelGrid>
        <h:commandButton action="#{u.createUser}" value="Register" />
    </h:form>
</h:body>
</html>